Tem 1 maneira melhor de se fazer isso, tipo assim:
Você é um player e esta level 1.
Quando você upar para o level 2 automaticamente você ganha este 1k + exp.
Se quizer usar assim, pode usar este aqui olha: \/ \/ \/
1° - Vai em data\creaturescripts\scripts crie um arquivo com nome levelrecompense.lua e dentro dele adicione isto:
function onAdvance(cid, oldLevel, newLevel)
local text = "Parabens, " .. getCreatureName(cid) .. " você chegou ao level 2, recebera por recompensa 1kk + x de experiencia!!!"
if getPlayerLevel(cid) >= 2 and getPlayerStorageValue(cid, 32647) <= 0 then
doPlayerSendTextMessage(cid,19,text)
doPlayerAddItem(cid,z,1) -- z coloca o id da moeda que vale 1kk
doPlayerAddExp(cid,x) -- x coloca o tanto de exp que ele vai ganhar
setPlayerStorageValue(cid, 32647, 1)
end
return true
end
2º - Va em login.lua e adicione esta tag:
registerCreatureEvent(cid, "levelrecompense")
3º - Por último vai em data\creaturescripts\creaturescripts.XML e adicione esta tag aqui:
<event type="advance" name="levelrecompense" event="script" value="levelrecompense.lua"/>
Créditos:
30% = Eu - GuhPk
70% = Snokiuthu - Criou o script
Ajudei? Da REP+ aew.



info
Grupo: Marquês
Registrado: 05/12/11
Posts: 1.2k
Reputação: +173
Gênero: Masculino
galera emtaum eu gostaria que o npc fosse assim eu sou o player upei do lvl 1 pro lvl 2 ai eu vo no npc e falo hi,yes e ele me da 1k e um poko de exp
aki ta a script mais nao consigo mudar ja tentei
local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false
function onThingMove(creature, thing, oldpos, oldstackpos, item, itemEx)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Good bye then.')
focus = 0
talk_start = 0
end
end
function onCreatureTurn(creature)
end
function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end
function onCreatureSay(cid, type, msg)
msg = string.lower(msg)
if (msgcontains(msg, 'hi') and focus == 0) and getDistanceToCreature(cid) < 4 then
if getPlayerStorageValue(cid, 8001) == 5 then
return selfSay('Você ja recebeu seu presente.')
end
setPlayerStorageValue(cid,8001,7)
selfSay('Você deseja receber seu presente?')
focus = cid
talk_start = os.clock()
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'yes') then
if getPlayerStorageValue(cid, 8001) == 2 then
return selfSay('Você ja recebeu seu presente!!.')
end
if getPlayerStorageValue(cid, 8001) == 7 then
return selfSay('Para receber seu presente você precisa terminar a quest!!.')
end
doPlayerAddExp(cid, 15330000) -- 15330000 é a experience que o player irá ganhar!
selfSay('Você foi presentiado com 1kk!!.')
setPlayerStorageValue(cid,8001,2)
setPlayerStorageValue(cid,8001,5)
focus = 0
talk_start = 0
end
elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Tchau!')
focus = 0
talk_start = 0
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('Bye.')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Bye.')
focus = 0
end
end
end